<?php
namespace App\WebSocket;
use EasySwoole\EasySwoole\ServerManager;
use EasySwoole\Socket\AbstractInterface\Controller;
use App\Pool\MysqlObject; 
use App\Pool\MysqlPool;//载入mysqlpool

use App\Model\UserModel;
use App\Model\ConditionBeanModel;
use EasySwoole\Spl\SplBean;
/**
 * Class Index
 *
 * 此类是默认的 websocket 消息解析后访问的 控制器
 *
 * @package App\WebSocket
 */
class UserInfo extends Controller
{
	//获取用户信息
  	static function getUserInfo($userId){
      $db = MysqlPool::defer();
      $messageModel = new UserModel($db);
      return $messageModel->getOne($userId);
    }

   static function countGroupMsg($groupId,$messageId){
    $db = MysqlPool::defer();
    $messageModel = new UserModel($db);
    return $messageModel->countUnreadMsg($groupId,$messageId);
  	
  }
}